package com.ydc.ln.tutorial.j2se.ms;

/**
 * 异常
 * 
 * @author ydc
 * @date 下午3:03:26 2013-7-10
 */
public class ExceptionTest {
    public static void main(String[] args) {
        ExceptionTest et = new ExceptionTest();
        et.test05();
        test06();
    }

    
    public static void test06 () {
        String str = "ab";
        str.compareTo("abc");
    }
    
    public void test05() {
        try {
            test04();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
    static void test04() throws Exception {
        
    }
    
    public int test03() {
        try {
            System.out.println("try");
        } catch (Exception e) {
            System.out.println("catch");
            return 0;
        } finally {
            System.out.println("finally");
        }
        
        System.out.println("test03");
        
        return 1;
    }
    
    public void test02() {
        String str = null;
        str.compareTo("abc");
    }
    
    public void test01() {
        System.out.println(4/0);
    }
}
